# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-enum
_gemname=$pkgname
pkgver=1.0.0
pkgrel=0
pkgdesc="A handy way to define enums in Ruby"
url="https://github.com/dblock/ruby-enum"
arch="noarch"
license="MIT"
depends="ruby"
checkdepends="
	ruby-i18n
	ruby-rspec
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/dblock/ruby-enum/archive/v$pkgver.tar.gz
	skip-coverage.patch"

build() {
	gem build $_gemname.gemspec
}

check() {
	rspec spec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
	local geminstdir="$gemdir/gems/$_gemname-$pkgver"

	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	rm -r "$gemdir"/cache \
		"$gemdir"/build_info \
		"$gemdir"/doc \
		"$geminstdir"/spec \
		"$geminstdir"/*.md
}

sha512sums="
84b22f4b09d7efa9243eeeb83edfa25d438d4448f65a366b95a1b544081f567aaf090e4c1456f110361f5aabf710c7c64f6777c6c1bb2c0336485276f3db78aa  ruby-enum-1.0.0.tar.gz
f02142db686f3ab57a46d4df76b192860f989c94bd32d91c146a1b3d36799935e0cb74729da47ebc18f4fbf32b4239073321f3ba0bed92a9edd9fcf45fc4ad7d  skip-coverage.patch
"
